package com.ltedu.system.factory;

import com.ltedu.common.vo.Result;
import com.ltedu.system.client.UserClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @ClassName: UserFeignFallbackFactory
 * @Auther: Jerry
 * @Date: 2020/11/14 11:26
 * @Desctiption: TODO
 * @Version: 1.0
 */
@Component
public class UserFeignFallbackFactory implements FallbackFactory<UserClient> {
    @Override
    public UserClient create(Throwable throwable) {
        return new UserClient() {

            @Override
            public Result info(String username) {
                return Result.fail("zhangsan");
            }
        };
    }
}
